Skip to content

improve: do not close infra client if same as client#3187

Merged
csviri merged 2 commits intooperator-framework:nextfrom
csviri:dontclose-client
Feb 26, 2026
Merged

improve: do not close infra client if same as client#3187
csviri merged 2 commits intooperator-framework:nextfrom
csviri:dontclose-client

Conversation

@csviri
Copy link
Collaborator

@csviri csviri commented Feb 26, 2026

This makes isses in case that the client is explicitly set - typically in KubeApiTest.
But after first test it closes client, so other tests are not able to run.

Signed-off-by: Attila Mészáros a_meszaros@apple.com

This makes isses in case that the client is explicitly set - typically in KubeApiTest.
But after first test it closes client, so other tests are not able to run.

Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Copilot AI review requested due to automatic review settings February 26, 2026 12:07
@openshift-ci openshift-ci bot requested review from metacosm and xstefank February 26, 2026 12:07
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a client lifecycle management issue in the LocallyRunOperatorExtension where the infrastructure Kubernetes client was being closed unconditionally after each test, even when it was the same instance as the operator's client. This caused problems when running multiple tests with an explicitly set client, as the first test would close the shared client making it unavailable for subsequent tests.

Changes:

  • Add conditional check before closing infrastructure client to prevent double-closing when both clients reference the same instance
  • Add explanatory comment describing the lifecycle management logic

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

…ator/junit/LocallyRunOperatorExtension.java

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Collaborator

@xstefank xstefank left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But where do we close the infra client then?

@csviri
Copy link
Collaborator Author

csviri commented Feb 26, 2026

But where do we close the infra client then?

Here we close it if it is not the same as the standard client

@csviri csviri merged commit bb01a06 into operator-framework:next Feb 26, 2026
23 of 25 checks passed
csviri added a commit that referenced this pull request Feb 28, 2026
---------

Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
csviri added a commit that referenced this pull request Mar 6, 2026
---------

Signed-off-by: Attila Mészáros <a_meszaros@apple.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants